﻿<?php
	session_start();
	error_reporting (E_ALL ^ E_NOTICE);
	include "./config/conn_database.php";
	$strSQL = "SELECT * 
			   FROM wed_member
			   WHERE mem_uname = '".$_POST['uname']."'
			   AND mem_pname = '".$_POST['pname']."'";
	$objQuery = mysql_query($strSQL);
	$objResult = mysql_fetch_array($objQuery);
	if($objResult){
		$_SESSION["mem_id"] = $objResult['mem_id'];
		$_SESSION["mem_uname"] = $objResult['mem_uname'];
		$_SESSION["mem_pname"] = $objResult['mem_pname'];
		echo "<script type='text/javascript'>";
		echo "alert('ยินดีตอนรับเข้าสู่ระบบ')";
		echo "</script>";
		echo "<meta http-equiv='refresh' content='0; url=admin_menu.php'>";		
	}else{
		echo "<script type='text/javascript'>";
		echo "alert('ชื่อผู้ใช้หรือรหัสผ่านผิดพลาด')";
		echo "</script>";
		echo "<meta http-equiv='refresh' content='0; url=contactus.php'>";
	}
	mysql_close($objConnect);
?>
